<?php

var_dump($_FILES['file1']);
echo(extract($_FILES['file1']));
//*

if($_FILES['file1']['error']==UPLOAD_ERR_OK)
{
	$ext = strtolower(pathinfo($_FILES['file1']['name'],PATHINFO_EXTENSION));

	switch($ext)
	{
		case 'jpg': case 'jpeg': case 'gif': case 'png': case 'bmp':
			break;
		default:
			echo "不是图片类型";
	}
	$destfile = "../upload/".basename($_FILES['file1']['name']);
	if(file_exists($destfile)){
		$destfile = "../upload/".a.".".(pathinfo($_FILES['file1']['name'],PATHINFO_EXTENSION));
		$ret = @move_uploaded_file($_FILES['file1']['tmp_name'],$destfile);
	}else{
		$ret = @move_uploaded_file($_FILES['file1']['tmp_name'],$destfile);
	}
	if($ret == FALSE)
		echo "Unable to move user photo!<br />\n";
	else
		echo "Moved user avatar to photos directory<br />\n";
}else{
	switch($_FILES['file1']['error'])
	{
		case UPLOAD_ERR_INI_SIZE:
		case UPLOAD_ERR_FORM_SIZE:
			echo "FileSize Out";
			break;
		case UPLOAD_ERR_PARTIAL:
			echo "IncompleteUpload";
			break;
		default:
			echo "say what?";
			break;

	}
}
//*/
?>
